package org.kwisatz.proxybot.filters;

import org.kwisatz.proxybot.FilterAdapter;
import org.kwisatz.proxybot.Message;

public class FakeVersion extends FilterAdapter
{
	public static final String VERSION=System.getProperty("proxybot.fakeVersion.msg");	

	@Override
	public String handleServerLine(String line, Message message)
	{
		if("\u0001VERSION\u0001".equals(message.getEndOfMsg()) &&
			Message.PRIVMSG.equals(message.getCommand()))
		{
			clientNotice.println("CTCP Version from "+message.getNick());
			context.getServer().println("NOTICE " + message.getNick() +
				" :\u0001VERSION " + VERSION + '\u0001');
			return null;			
		}
		return line;		
	}	
}
